import { Row } from 'ant-design-vue'
import { defineComponent, type PropType } from 'vue'
import type { JsonSchema, Slots } from '../types'

export default defineComponent({
  inheritAttrs: true,
  props: {
    schema: {
      type: Object as PropType<JsonSchema>,
      default: () => ({})
    },
    slots: {
      type: Object as PropType<Slots>,
      default: () => null
    }
  },
  setup(props) {
    return () => <Row {...props.schema.props} v-slots={{ ...props.slots, ...props.schema.slots }} />
  }
})
